//package com.allwees.bs.c.module.order.dto;
//
//import com.allwees.bs.c.module.order.entity.OrderFlowEntity;
//import com.allwees.bs.core.model.order.wf.refund.ERefundState;
//import com.allwees.core.common.util.StringUtil;
//import lombok.AllArgsConstructor;
//import lombok.Data;
//import lombok.NoArgsConstructor;
//
//import java.io.Serializable;
//
//@Data
////@ApiModel("订单退款信息")
//@AllArgsConstructor
//@NoArgsConstructor
//public class OrderRefundDTO implements Serializable {
//
////	@ApiModelProperty(value = "退款状态，和订单信息中refundState相同")
//	private ERefundState state;
//
////	@ApiModelProperty(value = "申请退款的信息,如果有多次申请退款，则是最新的一条")
//	private Request request;
//
////	@ApiModelProperty(value = "审核退款申请的结果，包括审核结果原因以及是否同意退款")
//	private Judge judge;
//
//	@Data
////	@ApiModel("申请退款信息")
//	@AllArgsConstructor
//	@NoArgsConstructor
//	private class Request {
////		@ApiModelProperty(value = "申请退款类型,和客户端申请时相同，")
//		private Integer refundType;
//
////		@ApiModelProperty(value = "退款原因")
//		private Integer reason;
//
////		@ApiModelProperty(value = "退款备注")
//		private String remark;
//
////		@ApiModelProperty(value = "退款图片")
//		private String[] photos;
//
//		private Request(OrderFlowEntity flowEntity) {
//			this.setRefundType(flowEntity.getType());
//			this.setReason(flowEntity.getReason());
//			this.setRemark(flowEntity.getRemark());
//			this.setPhotos(StringUtil.splitToArray(flowEntity.getPhotos()));
//		}
//	}
//
//	@Data
////	@ApiModel("审核退款的信息")
//	@AllArgsConstructor
//	@NoArgsConstructor
//	private class Judge {
////		@ApiModelProperty(value = "是否同意退款")
//		private Boolean isAccept;
//
////		@ApiModelProperty(value = "审核结果原因")
//		private Integer reason;
//
////		@ApiModelProperty(value = "审核结果备注")
//		private String remark;
//
////		@ApiModelProperty(value = "审核结果图片")
//		private String[] photos;
//
//		private Judge(Boolean isAccept, OrderFlowEntity flowEntity) {
//			this.setIsAccept(isAccept);
//			this.setReason(flowEntity.getReason());
//			this.setRemark(flowEntity.getRemark());
//			this.setPhotos(StringUtil.splitToArray(flowEntity.getPhotos()));
//		}
//	}
//
////	public OrderRefundDTO(OrderEntity orderEntity) {
////		int size = orderEntity.getFlows().size();
////
////		// flows为按时间顺序从小到大排序的
////		for(int i = size - 1; i >= 0; i--) {
////			OrderFlowEntity flowEntity = orderEntity.getFlows().get(i);
////			// 申请退款中
////			if(flowEntity.getAction().equals(IOrderService.ORDER_ACTION_USER_REQUEST_REFUND_ORDER)) {
////				if(orderEntity.getState().equals(IOrderService.ORDER_STATE_REFUND_REQUESTED)) {
////					this.setState(IOrderService.ORDER_REFUND_STATE_WAIT_JUDGEMENT);
////					this.setRequest(new Request(flowEntity));
////					break;
////				}
////			}
////			// 退款已被接受
////			else if(flowEntity.getAction().equals(IOrderService.ORDER_ACTION_ADMIN_ACCEPT_REFUND)) {
////				if(orderEntity.getState().equals(IOrderService.ORDER_STATE_CLOSED)) {
////					this.setState(IOrderService.ORDER_REFUND_STATE_ACCEPTED);
////					this.setJudge(new Judge(true, flowEntity));
////					// 再上一个动作必定是申请退款
////					this.setRequest(new Request(orderEntity.getFlows().get(i - 1)));
////					break;
////				}
////			}
////			// 退款已被拒绝
////			else if(flowEntity.getAction().equals(IOrderService.ORDER_ACTION_ADMIN_REJECT_REFUND)) {
////				this.setState(IOrderService.ORDER_REFUND_STATE_REJECTED);
////				this.setJudge(new Judge(false, flowEntity));
////				// 再上一个动作必定是申请退款
////				this.setRequest(new Request(orderEntity.getFlows().get(i - 1)));
////				break;
////			}
////			// 退款已取消
////			else if(flowEntity.getAction().equals(IOrderService.ORDER_ACTION_USER_CANCEL_REFUND_ORDER)) {
////				this.setState(IOrderService.ORDER_REFUND_STATE_CANCELED);
////				// 再上一个动作必定是申请退款
////				this.setRequest(new Request(orderEntity.getFlows().get(i - 1)));
////				break;
////			}
////			// 商家直接退款
////			else if(flowEntity.getAction().equals(IOrderService.ORDER_ACTION_MERCHANT_REFUND_ORDER)) {
////				this.setState(IOrderService.ORDER_REFUND_STATE_MERCHANT_REFUND);
////				this.setJudge(new Judge(false, flowEntity));
////				// 当是商家主动退款时，审核和申请信息相同
////				this.setRequest(new Request(flowEntity));
////				break;
////			}
////		}
////	}
//}
